package edu.gyu.myshop.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import edu.gyu.myshop.model.OrderDetail;
import edu.gyu.myshop.dao.OrderDetailDao;
import edu.gyu.myshop.service.OrderDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ls
 * @since 2024-06-18
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailDao, OrderDetail> implements OrderDetailService {

    @Autowired
    private OrderDetailDao orderDetailDao;


    @Override
    public IPage<OrderDetail> getOrderDetailsWithStatusOne(int page, int size) {
        Page<OrderDetail> orderPage = new Page<>(page, size);
        return orderDetailDao.findOrderDetailsByOrderStatus(orderPage, 1);
    }
}
